<include file="public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>

<div class="wrapper">
<!--    <include file="public/breadcrumb"/>-->
    <section class="content ">


        <!--新订单列表 基本信息-->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">基本信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <td>订单序号:</td>
                        <td>订单号:</td>
                        <td>用户昵称:</td>
                        <td>电话号码:</td>
                        <td>订单状态:</td>
                        <td>下单时间:</td>
                    </tr>
                    <tr>
                        <td>{$orderInfo.orderFoodsId}</td>
                        <td>{$orderInfo.orderFoodsNo}</td>
                        <td>{$orderInfo.user.nickName}</td>
                        <td>{$orderInfo.user.userMobile}</td>
                        <td>{$orderFoodsStatus[$orderInfo.orderStatus]}</td>
                        <td>{:date('Y-m-d H:i:s',$orderInfo.orderAddTime)}</td>
                    </tr>


                    <tr>
                        <td>实际支付:</td>
                        <td colspan="2">支付时间:</td>
                        <td>支付方式:</td>
                        <td colspan="2">第三方流水号:</td>
                    </tr>
                    <tr>
                        <td>{$orderInfo.orderActualPrice}</td>
                        <td colspan="2">{$orderInfo.orderPayTime > 0 ? date('Y-m-d H:i:s', $orderInfo.orderPayTime) : ""}</td>
                        <td>{$orderInfo.orderPayName}</td>
                        <td colspan="2">{$orderInfo.orderTransactionId}</td>
                    </tr>

                    <tr>
                        <td colspan="6">配送位置：</td>
                    </tr>
                    <tr>
                        <td colspan="7">{$orderInfo.shop.shopName}&ensp;&ensp;/&ensp;&ensp;{$orderInfo.orderPositionNo}号打位</td>
                    </tr>

                    <tr>
                        <td colspan="6">用户备注：</td>
                    </tr>
                    <tr>
                        <td colspan="7">{$orderInfo.orderNote}</td>
                    </tr>

<!--                    <tr>-->
<!--                        <td colspan="6">管理员备注：</td>-->
<!--                    </tr>-->
<!--                    <tr>-->
<!--                        <td colspan="7">{$orderInfo.orderAdminNote}</td>-->
<!--                    </tr>-->

                    </tbody>
                </table>
            </div>
        </div>
        <!--新订单列表 商品信息-->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">商品信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <td class="text-left">商品</td>
                        <td class="text-left">属性</td>
                        <td class="text-right">数量</td>
                        <td class="text-right">单品价格</td>
                        <td class="text-right">单品小计</td>
                        <!--<td class="text-right">操作</td>-->
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="orderGoods" id="orderGoods">
                        <tr>
                            <td class="text-left">{$orderGoods.goods_name}</td>
                            <td class="text-left">{$orderGoods.spec_key_name}</td>
                            <td class="text-right">{$orderGoods.goods_num}</td>
                            <td class="text-right">{$orderGoods.goods_price}</td>
                            <td class="text-right">{$orderGoods.goods_price_fee}</td>
                        </tr>
                    </volist>

                    <tr>
                        <td colspan="4" class="text-right">总计:</td>
                        <td colspan="2" class="text-left">{$orderInfo.orderPrice}</td>
                    </tr>
                    </tbody>
                </table>

            </div>
        </div>
        <!--新订单列表 操作信息-->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">操作信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <tbody>

                    <tr>
                        <div class="row">
                            <td class="text-right col-sm-2"><p class="margin">当前可执行操作：</p></td>
                            <td colspan="3">
                                <if condition="$orderInfo.orderStatus == '1'">
                                    <div class="input-group col-sm-6">
                                        <input style="margin-top: 10px;" class="btn btn-success" type="button" onclick="orderSubmit({$orderInfo.orderFoodsId})" value="完成订单">
                                    </div>
                                </if>
                            </td>
                        </div>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>


    </section>
</div>

<script>
    function orderSubmit(orderId){

        layer.confirm('确认完成该订单吗？', function(){

                $.ajax({
                    type: "POST",
                    url: "{:url('order/doOrderFoodsStatus')}",
                    data: {orderId:orderId},
                    dataType: 'json',
                    success: function(data) {
                        if (data.code == 200) {
                            layer.msg(data.msg, {icon: 1, time: 1000}, function() {
                                window.location.reload();
                            });
                        } else {
                            layer.msg(data.msg, {icon: 2, time: 3000});
                        }
                    }
                });


            }
        );


    }
</script>

</body>
</html>